Africa

Column

Tracking violence

Column

Tracking development

Income and Quality of Life by Levels of Violence: Gulf of Guinea 1990-2018

Focus on Ghana

column

Regional focus

Column

Ghana

Threats and Weaknesses

  • High level of debt (60% commercial) and risk of fiscal slippage
  • Private sector crowded out of the local credit market by public financing needs
  • Low public revenue: 13% of GDP
  • Infrastructure gaps (energy, transport)
  • Dependent on commodity prices: gold and oil (70% of exports), cocoa (16%, 30% with other agricultural products)
  • Weak banking sector: 14% doubtful loans in 2019, high credit costs

Data

column

Data sources

  • The Global Terrorism Data Base (GTD). Over 191,000 events of political violence by country, region, province, and city, from 1970 through 2018 by day, month, and year. The GTD further categorizes the number killed and wounded by type of attack, targets of attack, perpetrators, and mode of operation, for example, insurgency and civil war.

  • Life expectancy. Definition: Number of years a newborn infant could expect to live if prevailing patterns of age-specific mortality rates at the time of birth stay the same throughout the infant’s life. Source: UNDESA (2019a). World Population Prospects: The 2019 Revision. Rev 1. New York.. Accessed 30 April 2020.

  • Education. Definition: Average number of years of education received by people ages 25 and older, converted from education attainment levels using official durations of each level.
    Source: UNESCO Institute for Statistics (2020), Barro and Lee (2018), ICF Macro Demographic and Health Surveys, UNICEF Multiple Indicator Cluster Surveys and OECD (2019b).

  • Gross Domestic Product per capita. Definition: GDP in a particular period divided by the total population in the same period. Source: World Bank (2020a). World Development Indicators database. Washington, DC. Accessed 22 July 2020.

  • Foreign Direct Investment. Definition: Sum of equity capital, reinvestment of earnings, other longterm capital and short-term capital, expressed as a percentage of GDP. Source: World Bank (2020a). World Development Indicators database. Washington, DC.. Accessed 22 July 2020.

This study: sub-Saharan Africa countries from 1990 through 2018.

---
title: "Sub-Saharan Violence and Human Development"
author: Bill Foote
date: "`r Sys.Date()`"
#bibliography: references.bib
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    source_code: embed
---

```{r setup, include = FALSE, eval = TRUE, echo = FALSE, warning = FALSE, message = FALSE}

set.seed(4289) #as always, the answer is 42, or is it 89
library(flexdashboard)
library(cowplot)
library(RColorBrewer)
library(tidyverse)
library(ggdag)
library(knitr)
library(kableExtra)
library(plotly)
#
# ggplot helper
# 
plot_2_grid <- function( plot1, plot2, title_1= "Default" ){ 
    # build side by side plots
    plot_row <- plot_grid(plot1, plot2) # cowplot package
    # now add the title
    title <- ggdraw() + 
    draw_label(
      title_1,
      fontface = 'bold',
      x = 0,
      hjust = 0
    ) +
    theme(
      # add margin on the left of the drawing canvas,
      # so title is aligned with left edge of first plot
      plot.margin = margin(0, 0, 0, 7)
    )
    plot_grid(
    title, plot_row,
    ncol = 1,
    # rel_heights values control vertical title margins
    rel_heights = c(0.1, 1)
    )
  }
# load data
vio <- read_csv( "wfoote-gpd-violence-sub-sahara.csv")
d_all <- read_csv( "casualties-life-gdppc-map-sub.csv" )
```

Africa
===========================

Column
---------------------------

### Tracking violence

```{r}
df <- vio %>% 
    filter( region==11)
#df$q <- with(df, cut(casualties, quantile(casualties)))
#levels(df$q) <- paste(c("1st", "2nd", "3rd", "4th", "5th"), "Quantile")
#df$q <- as.ordered(df$q)

g <- list(
  scope = 'africa',
  showland = TRUE,
  #showframe = TRUE,
  landcolor = toRGB("gray85"),
  subunitcolor = toRGB("white"),
  countrycolor = toRGB("white")
)

fig <- plot_geo(df, locationmode = 'country names', sizes = c(1, 1000))
fig <- fig %>% add_markers(
    x = ~longitude, y = ~latitude, 
    size = ~ncasualty, 
    color = ~ncasualty, 
    frame = ~year, 
    hoverinfo = "text",
    text = ~paste(
      df$year, "
", df$country_txt, "
", "attack type: ", df$attacktype1_txt, "
", "target: ", df$targtype1_txt, "
", "killed: ", df$nkill , "
", "wounded: ", df$nwound) ) fig <- fig %>% layout(title = 'Killed and Wounded in Sub-Saharan Africa', geo = g) fig <- fig %>% animation_opts( 1000, easing = "elastic", redraw = TRUE ) fig ``` ```{r, eval=FALSE} df <- d_all #%>% # filter( year==2018) #df$q <- with(df, cut(casualties, quantile(casualties))) #levels(df$q) <- paste(c("1st", "2nd", "3rd", "4th", "5th"), "Quantile") #df$q <- as.ordered(df$q) g <- list( scope = 'africa', showland = TRUE, #showframe = TRUE, landcolor = toRGB("gray85"), subunitcolor = toRGB("white"), countrycolor = toRGB("white") ) fig <- plot_geo(df, locationmode = 'country names', sizes = c(1, 600)) fig <- fig %>% add_markers( x = ~lng, y = ~lat, size = ~casualties, color = ~casualties, frame = ~year, hoverinfo = "text", text = ~paste(df$year, "
", df$country, "
", "GDP pc", df$gdppc, "
", "Life expected", df$life, "
", "Casualties", df$casualties) ) fig <- fig %>% layout(title = 'Killed and Wounded in Sub-Saharan Africa', geo = g) fig <- fig %>% animation_opts( 1000, easing = "elastic", redraw = TRUE ) fig ``` Column -------------------------- ### Tracking development ```{r plot-gppd-life-vio-gulf, , echo = FALSE, fig.cap = "Income and Quality of Life by Levels of Violence: Gulf of Guinea 1990-2018\\label{fig:plot-gppd-life-vio-gulf}", out.width='100%'} library(plotly) p2 <- d_all %>% filter( country %in% c( "Benin", "Cameroon", "Central African Republic", "Chad", "Democratic Republic of the Congo", "Ghana", "Ivory Coast", "Mali", "Niger", "Nigeria")) %>% ggplot( aes( x=life, y=gdppc, size=casualties, group = year, color=country) ) + geom_point() + labs( x="life expectancy", y="gross domestic product per capita", title="Income and Quality of Life", subtitle="Sub-Saharan Africa 2010-2018") ggplotly( p2 ) ``` Focus on Ghana ========================= column ----------------- ### Regional focus ```{r} df <- vio %>% # filter( region==11) %>% filter( country_txt %in% c( "Benin", "Cameroon", "Central African Republic", "Chad", "Democratic Republic of the Congo", "Ghana", "Ivory Coast", "Mali", "Niger", "Nigeria")) #df$q <- with(df, cut(casualties, quantile(casualties))) #levels(df$q) <- paste(c("1st", "2nd", "3rd", "4th", "5th"), "Quantile") #df$q <- as.ordered(df$q) g <- list( scope = 'africa', showland = TRUE, #showframe = TRUE, landcolor = toRGB("gray85"), subunitcolor = toRGB("white"), countrycolor = toRGB("white") ) fig <- plot_geo(df, locationmode = 'country names', sizes = c(1, 1000)) fig <- fig %>% add_markers( x = ~longitude, y = ~latitude, size = ~ncasualty, color = ~ncasualty, frame = ~year, hoverinfo = "text", text = ~paste( df$year, "
", df$country_txt, "
", "attack type: ", df$attacktype1_txt, "
", "target: ", df$targtype1_txt, "
", "killed: ", df$nkill , "
", "wounded: ", df$nwound) ) fig <- fig %>% layout(title = 'Killed and Wounded in Sub-Saharan Africa: Gulf of Guinea', geo = g) fig <- fig %>% animation_opts( 1000, easing = "elastic", redraw = TRUE ) fig ``` Column ----------------- ### Ghana ```{r} library(plotly) p2 <- d_all %>% filter( country %in% c( "Benin", "Cameroon", "Central African Republic", "Chad", "Democratic Republic of the Congo", "Ghana", "Ivory Coast", "Mali", "Niger", "Nigeria", "Togo")) %>% ggplot( aes( x=life, y=gdppc, size=casualties, group = year, color=country) ) + geom_point() + labs( x="life expectancy", y="gross domestic product per capita", title="Income and Quality of Life", subtitle="Sub-Saharan Africa 1992-2018") ggplotly( p2 ) ``` ### Threats and Weaknesses - High level of debt (60% commercial) and risk of fiscal slippage - Private sector crowded out of the local credit market by public financing needs - Low public revenue: 13% of GDP - Infrastructure gaps (energy, transport) - Dependent on commodity prices: gold and oil (70% of exports), cocoa (16%, 30% with other agricultural products) - Weak banking sector: 14% doubtful loans in 2019, high credit costs Data ================= column ----------------- ### Data sources - **The Global Terrorism Data Base (GTD).** Over 191,000 events of political violence by country, region, province, and city, from 1970 through 2018 by day, month, and year. The GTD further categorizes the number killed and wounded by type of attack, targets of attack, perpetrators, and mode of operation, for example, insurgency and civil war. - **Life expectancy.** Definition: Number of years a newborn infant could expect to live if prevailing patterns of age-specific mortality rates at the time of birth stay the same throughout the infant’s life. Source: [UNDESA (2019a). World Population Prospects: The 2019 Revision. Rev 1. New York.](https://population.un.org/wpp/). Accessed 30 April 2020. - **Education.** Definition: Average number of years of education received by people ages 25 and older, converted from education attainment levels using official durations of each level. Source: UNESCO Institute for Statistics (2020), Barro and Lee (2018), ICF Macro Demographic and Health Surveys, UNICEF Multiple Indicator Cluster Surveys and OECD (2019b). - **Gross Domestic Product per capita.** Definition: GDP in a particular period divided by the total population in the same period. Source: World Bank (2020a). [World Development Indicators database. Washington, DC](http://data.worldbank.org). Accessed 22 July 2020. - **Foreign Direct Investment.** Definition: Sum of equity capital, reinvestment of earnings, other longterm capital and short-term capital, expressed as a percentage of GDP. Source: World Bank (2020a). [World Development Indicators database. Washington, DC.](http://data.worldbank.org). Accessed 22 July 2020. > This study: sub-Saharan Africa countries from 1990 through 2018.